<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>验证码</title>

    <link rel="stylesheet" href="/static/js/bootstrap/css/bootstrap.css">
</head>
<body>
    <form action='/captcha/' method='POST'>
        {% csrf_token %}
        {{ form }}
        <input type="submit" value="提交"/>
    </form>
    <script src="/static/admin/js/vendor/jquery/jquery.js"></script>
    <script src="/static/js/bootstrap/js/bootstrap.js"></script>
    <script>

        $('.captcha').click(function () {
            $.getJSON("/captcha/refresh/", function (result) {
                $('.captcha').attr('src', result['image_url']);
                $('#id_captcha_0').val(result['key'])
            });
        });
    </script>
</body>
</html>